
<%@page import="org.apache.commons.lang3.StringUtils"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.io.PrintWriter"%>
<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=utf-8"%>

<!doctype html>
<html class="no-js">
<head>
<%@ include file="./commoms/link.txt"%>
<script src="assets/js/pagejs/userinfo.js"></script>
<meta name="description" content="userinfo">
<style type="text/css">
label {
	font-family: sans-serif;
}

div[name] {
	padding: 20px, 10px, 10px, 20px;
}

h2 {
	margin: 10px;
	padding: 10px;
	font-family: sans-serif;
	background-color: #F0FFFF;
}

#birthday {
	background-color: #FFFFFF;
	cursor: pointer;
}
</style>
</head>
<body>
	<%@ include file="./commoms/userHeader.txt"%>

	<div class="admin-content">
		<div class="am-cf am-padding">
			<div class="am-fl am-cf">
				<strong class="am-text-primary am-text-lg">个人资料</strong>
			</div>
		</div>

		<hr />

		<div class="am-g">
			

			<div class="am-u-sm-12 am-u-md-8 ">
				<form class="am-form am-form-horizontal" action='api/user/profile/update.do'
					id="finishEEInfoformtooltip" data-am-validator method="post">
					<div id="baseInfo">
						<h2>基本信息</h2>
						<div class="am-form-group">
							<label for="realname" class="am-u-lg-3 am-form-label">真实姓名</label>
							<div class="am-u-lg-9">
								<input type="text" id="realname" placeholder="姓名"
									name="realname" required data-foolish-msg="请输入您的姓名" >
							</div>
						</div>

						<div class="am-form-group">
							<label class="am-u-lg-3 am-form-label" for="gender">性别</label>

							<div id="gender" class="am-u-lg-9">

								<label class="am-radio-inline"> <input type="radio"
									name="gender" value="男" id="boy">男
								</label> <label class="am-radio-inline"> <input type="radio"
									name="gender" value="女" id="girl">女
								</label>
							</div>
						</div>
				
							
						<div class="am-form-group">
							<label for="occupation" class="am-u-lg-3 am-form-label">职位</label>
							<div class="am-u-lg-9">
								<input type="text" id="occupation" placeholder="职位" name="occupation" maxlength="10">
							</div>
						</div>
						


						<div class="am-form-group">
							<label for="company" class="am-u-lg-3 am-form-label">所在公司</label>
							<div class="am-u-lg-9">
								<input type="text" placeholder="请输入所在公司，限制15字" id="company" name="company" placeholder="所在公司" maxlength="15">
							</div>
						</div>
	                    <div class="am-form-group">
							<label for="address" class="am-u-lg-3 am-form-label">家庭地址</label>
							<div class="am-u-lg-9">
								<textarea rows="6" id="address" name="address"
								class="am-form-field am-inline" 
								placeholder="请输入家庭地址，限制45字" required  data-foolish-msg="请输入家庭地址"></textarea>
							</div>
						</div>
					
					</div>




					<div id="EnterpriseContactInformation">
						<h2>联系方式</h2>

						<div class="am-form-group">
							<label for="qq" class="am-u-lg-3 am-form-label">QQ</label>
							<div class="am-u-lg-9">
								<input type="text" id="qq" name="qq" maxlength="11" data-foolish-msg="请输入QQ号"
									placeholder="请输入QQ号" pattern="^[1-9]{1}\d{4,10}" required>

							</div>
						</div>
							<div class="am-form-group">
							<label for="phone" class="am-u-lg-3 am-form-label" >紧急联系电话</label>
							<div class="am-u-lg-9">
								<input type="text" id="phone" name="phone" maxlength="11"
									placeholder="最好不要和注册账号一样" pattern="1[0-9]{10}" required data-foolish-msg="最好不要和注册账号一样">

							</div>
						</div>
						<div class="am-form-group">
							<label for="email" class="am-u-lg-3 am-form-label">电子邮件</label>
							<div class="am-u-lg-9">
								<input type="email" id="email" name="email"
									placeholder="输入你的电子邮件" data-foolish-msg="请输入电子邮件" required>

							</div>
						</div>


						<div class="am-form-group">
							<div class="am-u-lg-9 am-u-sm-push-3">
								<button id="submit" class="am-btn am-btn-primary">保存修改</button>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>

	</div>

	<a href="#"
		class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
		data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

	<script type="text/javascript">

	    
	myAjax(domain + '/api/user/profile/get.do', {}, function(t) {
		  if(t.code=='200')
			  {
			var data = t.result;
			if (data.realname != null)
				$('#realname').val(data.realname);
			if (data.occupation != null)
				$('#occupation').val(data.occupation);
		
			if (data.email != null)
				$('#email').val(data.email);
			if (data.qq != null)
				$('#qq').val(data.qq);
			if (data.phone != null)
				$('#phone').val(data.phone);
			if (data.address != null)
				$('#address').text(data.address);
			if (data.enrolyear != null)
				$('#enrolyear').val(data.enrolyear);
			if (data.company != null)
				$('#company').val(data.company);
			
		
			if (data.gender != null) {
				if (data.gender == '男')

					$('#boy').prop('checked', true);
				else
					$('#girl').prop('checked', true);
			} else
				$('#boy').prop('checked', true);
			  }
		
		});
		
			
		
	
		
		var $form = $('#finishEEInfoformtooltip');
		setFormValidate($form,function(data) {
		
			
    		if(data.code=='200')
			{
		window.location.href = 'userIndex.jsp';
			}
		if(data.code=='406')
		{
	myAlert('提示', '参数错误');
		}
		if(data.code=='403')
		{
			myAlert('提示', '重新登陆',function(){window.location.href = domain+'/Login.jsp';});
		}
	});
	
		$("form").submit(function(e){
	
		 return false;
			});
	
		
		
	</script>
</body>
</html>
